package string;

public class ReplaceAllDemo {
    public static void main(String[] args) {
        String line = "abc123def456ghi";
        String newline = line.replaceAll("[a-zA-Z]", "n");
        System.out.println(newline);

        //和谐用语
        String regex = "(wqnmlgb|dsb|nc|cnm|mdzz|nmsl|djb)";
        String message = "wqnmlgb!你个dsb!你怎么这么的nc!你个djb!";
        message = message.replaceAll(regex,"***");
        System.out.println(message);
    }
}
